package com.zoe.app;

import cn.hutool.core.date.DateUtil;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author Zoe.Zhang
 * @date 2021/10/24
 * @description
 */
@Component
public class JacksonConfig {
    @Bean
    public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
        return jackson2ObjectMapperBuilder ->
                jackson2ObjectMapperBuilder.dateFormat(DateUtil.newSimpleFormat("yyyy-MM-dd HH:mm:ss"));

    }
}
